package com.dingpeikeji.quickdeer.modules.rcpt.service;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.service.CrudService;
import com.dingpeikeji.quickdeer.core.modules.sys.entity.User;
import com.dingpeikeji.quickdeer.core.modules.sys.utils.UserUtils;
import com.dingpeikeji.quickdeer.modules.rcpt.dao.TRcptDao;
import com.dingpeikeji.quickdeer.modules.rcpt.entity.TRcpt;

/**
 * 发票信息Service
 * @author dingpei
 * @version 2017-03-03
 */
@Service
@Transactional(readOnly = true)
public class TRcptService extends CrudService<TRcptDao, TRcpt> {

	public TRcpt get(String id) {
		return super.get(id);
	}
	
	public List<TRcpt> findList(TRcpt tRcpt) {
		return super.findList(tRcpt);
	}
	
	public Page<TRcpt> findPage(Page<TRcpt> page, TRcpt tRcpt) {
		return super.findPage(page, tRcpt);
	}
	
	@Transactional(readOnly = false)
	public void save(TRcpt tRcpt) {
		super.save(tRcpt);
	}
	
	@Transactional(readOnly = false)
	public void confirm(TRcpt tRcpt) {
		User user = UserUtils.getUser();
		tRcpt.setConfirmid(user);
		tRcpt.setConfirmdate(new Date());
		dao.confirm(tRcpt);
	}
	
	@Transactional(readOnly = false)
	public void delete(TRcpt tRcpt) {
		super.delete(tRcpt);
	}
	
}